﻿using System.Collections.Generic;
using System.Linq;

namespace GpgCore.Products
{
    public partial class MiningScheme
    {
        public ProductType OutputProduct;
        public int MinedPerWorker;
        public int WorkersPerLevel;
    }

    public partial class MiningScheme
    {
        public static List<MiningScheme> Schemes;
        public static MiningScheme FindScheme(ProductType product)
        {
            return Schemes.FirstOrDefault(p => p.OutputProduct == product);
        }

        static MiningScheme()
        {
            Schemes = new List<MiningScheme>();
            FillSchemesByStaticData();
        }

        private static void FillSchemesByStaticData()
        {
            Schemes.Add(new MiningScheme
                            {
                                OutputProduct = ProductType.Oil,
                                MinedPerWorker = 30,
                                WorkersPerLevel = 2000
                            });
            Schemes.Add(new MiningScheme
                            {
                                OutputProduct = ProductType.IronOre,
                                MinedPerWorker = 30,
                                WorkersPerLevel = 2000
                            });
            Schemes.Add(new MiningScheme
                            {
                                OutputProduct = ProductType.Coal,
                                MinedPerWorker = 30,
                                WorkersPerLevel = 2000
                            });
            Schemes.Add(new MiningScheme
                            {
                                OutputProduct = ProductType.Minerals,
                                MinedPerWorker = 30,
                                WorkersPerLevel = 2000
                            });
        }
    }
}
